<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>New Document</TITLE>
<meta http-equiv="Cotent-Type" content="text/html; charset=utf-8">
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script type="text/javascript" src="../jquery.js"></script>
<script type="text/javascript" src="../TC.js"></script>
<style type="text/css">

</style>
</HEAD>

<BODY>
<textarea rows="5" cols="80" id="test"></textarea>
<textarea rows="2" cols="80" id="test1"></textarea>
sss
<div class="tree" style="width: 300px; height: 800px; overflow: auto; position: relative;">
<div class="treeRow"><span class="treeNode"><span class="treeIndent"></span><span
	class="nodeText">ROOT</span></span>
<div class="subTree">
<div class="treeRow"><span class="treeNode"><span class="treeIndent"></span><span
	class="icon_T">&nbsp;&nbsp;</span><span class="nodeText">tree1</span></span>
<div class="subTree">
<div class="treeRow"><span class="treeNode"><span class="treeIndent"><span
	class="icon_I">&nbsp;&nbsp;</span></span><span class="icon_T">&nbsp;&nbsp;</span><span class="nodeText">tree11</span></span>
<div class="subTree">
<div class="treeRow"><span class="treeNode"><span class="treeIndent"><span
	class="icon_I">&nbsp;&nbsp;</span><span class="icon_I">&nbsp;&nbsp;</span></span><span class="icon_L">&nbsp;&nbsp;</span><span
	class="nodeText">tree111</span></span>
<div class="subTree"></div>
</div>
</div>
</div>
<div class="treeRow"><span class="treeNode"><span class="treeIndent"><span
	class="icon_I">&nbsp;&nbsp;</span></span><span class="icon_L">&nbsp;&nbsp;</span><span class="nodeText">tree12</span></span>
<div class="subTree"></div>
</div>
</div>
</div>
<div class="treeRow"><span class="treeNode"><span class="treeIndent"><span
	class="icon_L">&nbsp;&nbsp;</span></span><span class="nodeText">tree2</span></span>
<div class="subTree"></div>
</div>
</div>
</div>
</div>
sss
</BODY>
<script type="text/javascript">
function genTree(id,level){
	var tree=[];
	id=id||'';
	var me = arguments.callee;
	if(level==undefined){
		level=Math.floor(Math.random()*6)*0+3;//5
	}else if(level==0){
		return tree;
	}
	var nodes=Math.floor(Math.random()*5)*0+3;//3
	for(var i=0;i<nodes;i++){
		var tmp=id.concat(i,'中文');
		tree.push({id:tmp,text:tmp,exppand:true,children:me(tmp,level-1)});
	}
	return tree;
}

function serializeJSON(o) {
	var objtype = typeof(o);
	if (objtype == "undefined") {
	return "null";
	} else if (objtype == "number" || objtype == "boolean") {
	return o + "";
	} else if (o === null) {
	return "null";
	}
	if (objtype == "string") {
	return reprString(o);
	}
	if(objtype == 'object' && o.getFullYear) {
	return reprDate(o);
	}
	var me = arguments.callee;
	if (objtype != "function" && typeof(o.length) == "number") {
	var res = [];
	for (var i = 0; i < o.length; i++) {
	  var val = me(o[i]);
	  if (typeof(val) != "string") {
	      val = "undefined";
	  }
	  res.push(val);
	}
	return "[" + res.join(",") + "]";
	}
	// it's a function with no adapter, bad
	if (objtype == "function")
	return null;
	res = [];
	for (var k in o) {
	var useKey;
	if (typeof(k) == "number") {
	  useKey = '"' + k + '"';
	} else if (typeof(k) == "string") {
	  useKey = reprString(k);
	} else {
	  // skip non-string or number keys
	  continue;
	}
	val = me(o[k]);
	if (typeof(val) != "string") {
	  // skip non-serializable values
	  continue;
	}
	res.push(useKey + ":" + val);
	}
	return "{" + res.join(",") + "}";
}
function reprString(o) {
	return ('"' + o.replace(/(["\\])/g, '\\$1') + '"'
	).replace(/[\f]/g, "\\f"
	).replace(/[\b]/g, "\\b"
	).replace(/[\n]/g, "\\n"
	).replace(/[\t]/g, "\\t"
	).replace(/[\r]/g, "\\r");
}

function reprDate(db) {
	var year = db.getFullYear();
	var dd = db.getDate();
	var mm = db.getMonth()+1;
	
	var hh = db.getHours();
	var mins = db.getMinutes();
	
	function leadingZero(nr) {
	if (nr < 10) nr = "0" + nr;
	return nr;
	}
	if(hh == 24) hh = '00';
	
	var time = leadingZero(hh) + ':' + leadingZero(mins);
	return '"' + year + '-' + mm + '-' + dd + 'T' + time + '"';
}
</script>
</HTML>
